<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .box1,
        .box2,
        .box3,
        .box4 {
            height: 200px;
            border-bottom: 1px solid black;
        }

        .inner1,
        .inner2,
        .inner3,
        .inner4 {
            height: 100px;
            width: 100px;
            background-color: #2ef;
        }


        .box1 {
            text-align: center;
        }

        .inner1 {
            display: inline-block;
        }


        .inner2 {
            margin: 0 auto;
        }

        .box3 {
            position: relative;
        }

        .inner3 {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }

        .box4 {
            display: flex;
            justify-content: center;
            align-items: center;
        }
    </style>
</head>

<body>

    <div class="box1">
        <div class="inner1"></div>
    </div>
    <div class="box2">
        <div class="inner2"></div>
    </div>
    <div class="box3">
        <div class="inner3"></div>
    </div>
    <div class="box4">
        <div class="inner4"></div>
    </div>
</body>

</html>